package flex.cc.uac.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import flex.cc.core.support.BaseController;
import flex.cc.uac.dto.log.UacLogMainDto;
import flex.cc.uac.entity.UacLogEntity;
import flex.cc.uac.service.UacLogService;
import flex.cc.wrapper.WrapMapper;
import flex.cc.wrapper.Wrapper;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 日志管理.
 */
@RestController
@RequestMapping(value = "/log")
public class UacLogController extends BaseController {
	@Resource
	private UacLogService uacLogService;

	/**
	 * 查询日志列表.
	 */
	@PostMapping(value = "/queryListWithPage")
	@ApiOperation(httpMethod = "POST", value = "查询日志列表")
	public Wrapper<IPage<UacLogEntity>> queryLogListWithPage(@ApiParam(name = "uacLogQueryDtoPage", value = "日志查询条件") @RequestBody UacLogMainDto uacLogQueryDtoPage) {
		logger.info("查询日志处理列表 uacLogQueryDtoPage={}", uacLogQueryDtoPage);
		IPage<UacLogEntity> page = uacLogService.queryLogListWithPage(uacLogQueryDtoPage);
		return WrapMapper.ok(page);
	}
}
